﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<SportStore.DomainModel.Entities.Product>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Admin:  All Products
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h1>All Products</h1>
<table class="Grid">
    <tr>
        <th>ID</th>
        <th>Name</th>
        <th class="NumericCol">Price</th>
        <th>Actions</th>
    </tr>
    <% foreach (var item in Model) { %>
        <tr>
            <td><%= item.ProductID %></td>
            <td><%= item.Name %></td>
            <td class="NumericCol"><%= item.Price.ToString("c")%></td>
            <td>
                <%= Html.ActionLink("Edit", "Edit", new {item.ProductID}) %>
                <%= Html.ActionLink("Delete", "Delete", new {item.ProductID}) %>
            </td>
        </tr>
    <% } %>
    </table>
    <p><%= Html.ActionLink("Add a new product", "Create") %></p>
</asp:Content>
